Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): reorder the EndBlockers #98

Merged

Conversation

MaxMustermann2
Copy link
Contributor

@MaxMustermann2 MaxMustermann2 commented Jun 12, 2024

commit e5a6ddc
Author: MaxMustermann2 [email protected]
Date: Wed Jun 12 09:35:49 2024 +0000

fix(app): reorder the EndBlockers

The `EndBlockers` do the following jobs:
- `x/operator` saves the USD value for delegations, indexed by operator.
- `x/dogfood` uses the USD value obtained from `x/operator` to calculate
  the new voting power and forwards the new validator set to Tendermint.
  It also decreases the hold count on pending undelegations maturing at
  that epoch, from the perspective of the dogfood-AVS.
- `x/delegation` releases any matured undelegations and makes assets
  available for withdrawal.
- `x/oracle` fetches the new voting power from `x/dogfood` and prepares
  for the next round.

The new order is updated to reflect the above functions. As a
consequence, delegations made during blocks just before the epoch ends
will also accurately update the vote power of the validators.

Summary by CodeRabbit

  • Chores

    • Updated Go version from 1.21.9 to 1.21.11 in various GitHub Actions workflows, Dockerfiles, and configuration files to ensure compatibility and security.
  • Refactor

    • Reorganized module initialization order in the application setup to improve logical flow and maintainability.

till they can be fixed
The `EndBlockers` do the following jobs:
- `x/operator` saves the USD value for delegations, indexed by operator.
- `x/dogfood` uses the USD value obtained from `x/operator` to calculate
  the new voting power and forwards the new validator set to Tendermint.
  It also decreases the hold count on pending undelegations maturing at
  that epoch, from the perspective of the dogfood-AVS.
- `x/delegation` releases any matured undelegations and makes assets
  available for withdrawal.
- `x/oracle` fetches the new voting power from `x/dogfood` and prepares
  for the next round.

The new order is updated to reflect the above functions. As a
consequence, delegations made during blocks just before the epoch ends
will also accurately update the vote power of the validators.
Copy link
Contributor

coderabbitai bot commented Jun 12, 2024

Warning

Rate limit exceeded

@MaxMustermann2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 19 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 543649c and 3489d11.

Walkthrough

This update primarily focuses on upgrading the Go version from 1.21.9 to 1.21.11 across various configuration files, Dockerfiles, and GitHub Actions workflows to ensure compatibility and leverage the latest features and fixes. Additionally, there are minor changes to the NewExocoreApp function in app/app.go to reorganize the initialization flow of different modules within the application.

Changes

Files/Groups Change Summary
.github/workflows/ante-benchmark.yml
.github/workflows/build.yml
.github/workflows/dependencies.yml
.github/workflows/goreleaser.yml
.github/workflows/lint.yml
.golangci.yml
go.mod
Dockerfile
networks/local/exocore/Dockerfile
Makefile
Updated Go version from 1.21.9 to 1.21.11.
.github/workflows/proto-comment.yml
.github/workflows/test-comment.yml
Modified conditional checks to disable certain jobs under all conditions.
app/app.go Reorganized the NewExocoreApp function to adjust the initialization flow of various modules.

Poem

In code's vast and intricate maze,
We’ve polished paths in subtle ways.
From 1.21.9 to .11 we stride,
With Go's new strengths, we now abide.
Modules shuffled, workflows tuned,
Our software’s symphony, finely attuned.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d6410b2 and 543649c.

Files selected for processing (13)
  • .github/workflows/ante-benchmark.yml (1 hunks)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/dependencies.yml (1 hunks)
  • .github/workflows/goreleaser.yml (1 hunks)
  • .github/workflows/lint.yml (1 hunks)
  • .github/workflows/proto-comment.yml (1 hunks)
  • .github/workflows/test-comment.yml (1 hunks)
  • .golangci.yml (1 hunks)
  • Dockerfile (1 hunks)
  • Makefile (1 hunks)
  • app/app.go (1 hunks)
  • go.mod (1 hunks)
  • networks/local/exocore/Dockerfile (1 hunks)
Files skipped from review due to trivial changes (12)
  • .github/workflows/ante-benchmark.yml
  • .github/workflows/build.yml
  • .github/workflows/dependencies.yml
  • .github/workflows/goreleaser.yml
  • .github/workflows/lint.yml
  • .github/workflows/proto-comment.yml
  • .github/workflows/test-comment.yml
  • .golangci.yml
  • Dockerfile
  • Makefile
  • go.mod
  • networks/local/exocore/Dockerfile
Additional comments not posted (1)
app/app.go (1)

942-947: The reordering of EndBlockers appears correctly aligned with the module dependencies described in the PR. This change should ensure that delegations made just before the epoch ends will now accurately update the vote power of validators.

@MaxMustermann2 MaxMustermann2 merged commit 324070f into ExocoreNetwork:develop Jun 13, 2024
18 checks passed
cloud8little added a commit to cloud8little/exocore that referenced this pull request Jun 21, 2024
* fix(cli,oracle): export + vote power (ExocoreNetwork#53)

* fix(oracle):skip cache commit when refill cache on node restart

* text: add comments

* fix(oracle):set recentParams when commit cached params

* typo(oracle):lint

* fix:CVE-2024-3817, update getter to 1.7.4

* fix(cli): make `export` work again

* fix(dogfood): remove debug line

* refactor(dogfood): load `AccAddress` for val

* fix(oracle): use `GetConsensusPower` correctly

The `v.GetConsensusPower` function expects the power reduction factor as
a parameter, and not the number of bonded tokens (that is available to
the validator object anyway).

* fix(cli): pass `chainID` via `ctx` and not param

Tested with `exocored export | jq`

* fix(ci): remove deprecated config

* fix(test): remove call count for GetBondedTokens

---------

Co-authored-by: leonz789 <[email protected]>
Co-authored-by: cloud8little <[email protected]>

* fix(delegation): don't error if no delegations (ExocoreNetwork#60)

* fix(delegation): don't error if no delegations

If both the operator and its stakers exit the system, the TotalAmount
and TotalShare are 0. In that event, it is not erroneous to return a
value of 0 for the share and the amount, respectively.

Updates tests as well

Fixes ExocoreNetwork#59

* chore: use lowercase for local var

* feat: CLIs for delegation, operator, dogfood (ExocoreNetwork#46)

* refactor(operator): use flags to RegisterOperator

Instead of relying on the positioning of arguments, the flags mechanism
(as seen in the Cosmos SDK's x/staking) offers a cleaner approach.

* feat(operator): add commission rate to CLI

* refactor(operator): validate registration input

* feat(operator): add `OptIn` to AVS function

* refactor(assets): remove app chains

These should be in the AVS module anyway.

* fix(operator): share `opt.go`, `consensus_keys.go`

An operator must first opt into the chain-as-an-AVS before assigning a
consensus key for said chain. Similarly, to opt out, the operator must
first remove their key and then opt out.

* fix(operator): correct interface

* fix(dogfood): remove unused code

* feat(operator): add AVS opt out CLI

* fix(operator): implement msg server

* feat(operator): implement cons key interfaces

* fix(operator): skip opting out operators from list

* fix typos

* fix(dogfood): update operator hook assumptions

* feat(operator): add QueryAllOperatorKeysByChainID

* feat(operator): implement QueryOperatorConsAddress

* feat(operator): implement QueryAllOperatorConsAddr

* feat(dogfood): implement QueryOptOutsToFinish

* feat(dogfood): QueryOperatorOptOutFinishEpoch

* feat(delegation): query undelegation hold count

* feat(dogfood): implement QueryUndelegationsToMature

* fix(delegation): use string record key type

* feat(dogfood): query undelegation maturity epoch

* feat(dogfood): query validator

* fix(operator): allow build

* fix(dogfood): actually schedule cons addr prune

* chore: lint and tests

* fix: use consistent naming of query members

* remove unused comments

* doc: update comment for why chain not chain_id

* fix(operator): add Router for tx

* chore(lint)

* fix(test): fix operator tests, disable 1

* fix(proto): prevent complains about duplicate reg

* fix(operator): query operator CLI with address

* feat(operator): add set-cons-key and removal cli

* fix(dogfood,operator): clear prev keys correctly

AVSs are free to choose their own epoch schedule. The previous key needs
to be cleared only at epoch end (and not at block end as it was done
previously). Additionally, it is specific to the AVS identifier (the
chainID in the case of the dogfood module) that should be cleared.

BREAKING: the format of storing the previous consensus keys has changed.
Previously, they were indexed by operator's AccAddress and chainID. Now
they are indexed by the reverse of it, that is, chainID + AccAddress.
This is done to ensure easy clearing of the data for each specific AVS.

BREAKING: the `prefixSlashAssetsState` and another prefix were sharing
the same value of 5 `BytePrefixForOperatorAndChainIDToConsKey`. This has
been fixed.

* fix(operator): remove pointer receiver

* refactor: clarify all vs active operators

* feat(operator): add get all operators query

* fix(operator): parse cons key correctly

* chore(lint): placate proto-lint

* chore(lint): placate golang lint

* fix(operator): impl for msgs GetSignBytes, Type

Without these functions implemented, sending a transaction with the
wrong chain-id produces a panic while verifying the signature. This
panic happens on the receiving node (and not the sender), although
consensus isn't impacted.

With these functions implemented, the receiving node replies "signature
verification failed, please verify account number (%d) and chain-id
(%s)". If the transaction were only legacy amino, even the "sequence
(%d)" would have shown up in the error message.

* fix: validatorupdateblock update every block cause messy of upgrade (ExocoreNetwork#57)

* fix(oracle): add copy of aggregatorContext for checkTx-mode of execution (ExocoreNetwork#50)

* fix(oracle): add copy of aggregatorContext for checkTx-mode of execution

* fix lint

* fix(oracle):use set to copy bigInt

* fix(oracle):deep copy on price

* fix(oracle):get rid of map in cache for deteministic serialize

* fix(oracle):bigint set, slice initialize

* GetConsensusPower should have reduction as input

* test(oracle): remove unused monkey-patch

* test: remove unused monkey mock

* fix: error retruned by precompiled contract can not be caught with tr… (ExocoreNetwork#69)

* fix: error retruned by precompiled contract can not be caught with try/catch in EVM

* fix withdraw_integrate_test

* fix failed tests and add some TODO comments

* patch clientchains precompile

* [fix] Fix the issue regarding voting power not taking effect (ExocoreNetwork#65)

* fix the issue ExocoreNetwork#58 regarding voting power not taking effect

* change prepareDelegation to be compatible with PR61

* update ibc-go to v7.4.0 to fix the Vulnerability GO-2024-2694

* change the epoch configuration to hour when start a local node through the local_node.sh

* using shfmt to fix the shell lint error

* refactor: refactor avs and add test

* oracle:add fields for params (ExocoreNetwork#75)

* oracle:add fields for params

* udpate default params with new fields

* fix lint

* test(oracle): convert int type

* feat(build): add commit hash in version name (ExocoreNetwork#76)

* fix:fix golangci-lint error

* fix:fix issues in comments

* fix(assets,delegation): case insensitive query (ExocoreNetwork#80)

* fix(delegation): convert query to lowercase

* fix(assets): convert query to lowercase

* refactor(assets,delegation): check case with flag

* fix(assets,delegation): stateless validate cli

* fix(assets): deprecate StakerExoCoreAddr

* fix(assets): remove StakerExoCoreAddr

* fix(assets): require non-zero address length (ExocoreNetwork#82)

* fix(localnet): set `address_length`

* fix(assets): validate non-zero address length

* fix(app): reorder the EndBlockers (ExocoreNetwork#98)

* chore: update go version to 1.21.11

* fix(ci): disable buggy workflows

till they can be fixed

* fix(app): reorder the EndBlockers

The `EndBlockers` do the following jobs:
- `x/operator` saves the USD value for delegations, indexed by operator.
- `x/dogfood` uses the USD value obtained from `x/operator` to calculate
  the new voting power and forwards the new validator set to Tendermint.
  It also decreases the hold count on pending undelegations maturing at
  that epoch, from the perspective of the dogfood-AVS.
- `x/delegation` releases any matured undelegations and makes assets
  available for withdrawal.
- `x/oracle` fetches the new voting power from `x/dogfood` and prepares
  for the next round.

The new order is updated to reflect the above functions. As a
consequence, delegations made during blocks just before the epoch ends
will also accurately update the vote power of the validators.

* chore: lint

* fix(docker): update to new alpine

* feat(ci): add `docker build` CI

* chore(ci): run `lint` on workflows

* chore(ci): run `lint` on workflows again

* fix(ci): trigger Dockerbuild only if file changes

* fix(ci): remove backticks from workflow name

* fix(ci): lint the workflow again

* fix(ci): use correct path to trigger

* feat(epochs): backport the epochs module

* fix: run go mod tidy

* fix(local): minute-wise epochs

* fix(dogfood): set default unbonding duration 7 day

* fix(local): unbond at 2 epochs

* fix(ci): fix failing jobs

* refactor(epochs): respond to ai review

* fix(ci): specify go version in consensuswarn (ExocoreNetwork#103)

* fix(docs): add `the` before module

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* refactor(dogfood): return cons key in `Validator` (ExocoreNetwork#72)

* refactor(dogfood): return cons key in `Validator`

Until `x/dogfood` was made compatible with `x/evm` and `x/oracle`, a
`nil` validator was being returned by `ValidatorByConsAddr`. This
validator was correctly processed by the `x/evidence` module when it
handled equivocation evidence.

However, with the changes introduced for compatibiltiy with `x/evm`, the
validator returned is no longer nil. Such a validator will have an
operator address, whose presence will trigger a call to `Validator`,
which is implemented by this change.

* fix(dogfood): add expected keeper interface

* fix(dogfood): return `validator` not `val`

* fix(operator,dogfood): return val with key

* fix(dogfood): correctly set bonded status

The validators loaded from x/dogfood are considered bonded, while the
validators pulled from x/operator can have any status.

* doc(dogfood): add error logs

* fix(ci): specify go version in consensuswarn

* epochs: return block time in query

The returned block time can be used to determine whether any of the
epochs are about to change.

* doc(epochs): clarify no problems with timezones

* fix(ci): provide github token to buf setup

avoid rate limits

* feat(dogfood): implement `ExportGenesis` (ExocoreNetwork#95)

* feat(dogfood): re-scaffold genesis

In preparation for the `ExportGenesis` implementation, re-scaffold the
genesis state of the dogfood module.

* fix(dogfood): remove deprecated keys

* refactor: use new dogfood genesis

* refactor(dogfood): - validatorupdate from gen

* refactor(dogfood): update ImportGenesis

...for new genesis structure

* refactor(dogfood): simplify gen state names

* feat(dogfood): implement ExportGenesis

Partially resolves ExocoreNetwork#54

* chore: lint

* proto(dogfood): remove unused import

* fix(local): compat with new dogfood genesis

* chore: lint proto file and gen

* fix(test): use correct struct member name

* chore: update go version to 1.21.11

* fix(ci): disable buggy workflows

till they can be fixed

* chore: lint

* fix(dogfood): don't stop iterating in export

The return value should be `false` to continue

* fix(doc): add comment about exported validators

* doc(dogfood): log iteration failure

If such an iteration failure happens during export, a pipe to `jq` will
fail and inform the user of the failure.

* docs(delegation): validation of record key params

* fix(app): register operator hooks for dogfood

* feat(operator): return `OptingOut` status

Whenever a query for consensus keys or addresses is answered, it should
specify whether the operator is currently in the process of opting out.
This is because the data is retained until the opt out is complete, even
though the operator may not be actively validating. The purpose of the
data retention, as always, is to slash the operator (if required), based
on the key.

* refactor(operator): rationalize opt-in/out

When an operator opts into an AVS, they should be required to supply the
consensus (or other) key to opt-in. Similarly, when they opt-out, the
key should automatically be removed.

This commit implements that functionality, however, it is restricted to
`ctx.ChainID()`. For an overbroad implementation, an AVS registry from
AVS address -> key type should be implemented.

* refactor(delegation): verbose panic

* fix(dogfood): query validator by cons addr not hex

* refactor(dogfood): move opt func to correct loc

* chore(x/operator): lint go

* fix(operator): wrap and return error

---------

Co-authored-by: cloud8little <[email protected]>

* feat(ci): allow super-linter running with act

Example usage:
act --workflows .github/workflows/super-linter.yml pull_request

* remove unused file

* fix: typo in script

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: leonz789 <[email protected]>
Co-authored-by: Leon <[email protected]>
Co-authored-by: adu <[email protected]>
Co-authored-by: TimmyExogenous <[email protected]>
Co-authored-by: trestin <[email protected]>
Co-authored-by: trestin-web3 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
cloud8little added a commit to cloud8little/exocore that referenced this pull request Jun 21, 2024
* fix(cli,oracle): export + vote power (ExocoreNetwork#53)

* fix(oracle):skip cache commit when refill cache on node restart

* text: add comments

* fix(oracle):set recentParams when commit cached params

* typo(oracle):lint

* fix:CVE-2024-3817, update getter to 1.7.4

* fix(cli): make `export` work again

* fix(dogfood): remove debug line

* refactor(dogfood): load `AccAddress` for val

* fix(oracle): use `GetConsensusPower` correctly

The `v.GetConsensusPower` function expects the power reduction factor as
a parameter, and not the number of bonded tokens (that is available to
the validator object anyway).

* fix(cli): pass `chainID` via `ctx` and not param

Tested with `exocored export | jq`

* fix(ci): remove deprecated config

* fix(test): remove call count for GetBondedTokens

---------

Co-authored-by: leonz789 <[email protected]>
Co-authored-by: cloud8little <[email protected]>

* fix(delegation): don't error if no delegations (ExocoreNetwork#60)

* fix(delegation): don't error if no delegations

If both the operator and its stakers exit the system, the TotalAmount
and TotalShare are 0. In that event, it is not erroneous to return a
value of 0 for the share and the amount, respectively.

Updates tests as well

Fixes ExocoreNetwork#59

* chore: use lowercase for local var

* feat: CLIs for delegation, operator, dogfood (ExocoreNetwork#46)

* refactor(operator): use flags to RegisterOperator

Instead of relying on the positioning of arguments, the flags mechanism
(as seen in the Cosmos SDK's x/staking) offers a cleaner approach.

* feat(operator): add commission rate to CLI

* refactor(operator): validate registration input

* feat(operator): add `OptIn` to AVS function

* refactor(assets): remove app chains

These should be in the AVS module anyway.

* fix(operator): share `opt.go`, `consensus_keys.go`

An operator must first opt into the chain-as-an-AVS before assigning a
consensus key for said chain. Similarly, to opt out, the operator must
first remove their key and then opt out.

* fix(operator): correct interface

* fix(dogfood): remove unused code

* feat(operator): add AVS opt out CLI

* fix(operator): implement msg server

* feat(operator): implement cons key interfaces

* fix(operator): skip opting out operators from list

* fix typos

* fix(dogfood): update operator hook assumptions

* feat(operator): add QueryAllOperatorKeysByChainID

* feat(operator): implement QueryOperatorConsAddress

* feat(operator): implement QueryAllOperatorConsAddr

* feat(dogfood): implement QueryOptOutsToFinish

* feat(dogfood): QueryOperatorOptOutFinishEpoch

* feat(delegation): query undelegation hold count

* feat(dogfood): implement QueryUndelegationsToMature

* fix(delegation): use string record key type

* feat(dogfood): query undelegation maturity epoch

* feat(dogfood): query validator

* fix(operator): allow build

* fix(dogfood): actually schedule cons addr prune

* chore: lint and tests

* fix: use consistent naming of query members

* remove unused comments

* doc: update comment for why chain not chain_id

* fix(operator): add Router for tx

* chore(lint)

* fix(test): fix operator tests, disable 1

* fix(proto): prevent complains about duplicate reg

* fix(operator): query operator CLI with address

* feat(operator): add set-cons-key and removal cli

* fix(dogfood,operator): clear prev keys correctly

AVSs are free to choose their own epoch schedule. The previous key needs
to be cleared only at epoch end (and not at block end as it was done
previously). Additionally, it is specific to the AVS identifier (the
chainID in the case of the dogfood module) that should be cleared.

BREAKING: the format of storing the previous consensus keys has changed.
Previously, they were indexed by operator's AccAddress and chainID. Now
they are indexed by the reverse of it, that is, chainID + AccAddress.
This is done to ensure easy clearing of the data for each specific AVS.

BREAKING: the `prefixSlashAssetsState` and another prefix were sharing
the same value of 5 `BytePrefixForOperatorAndChainIDToConsKey`. This has
been fixed.

* fix(operator): remove pointer receiver

* refactor: clarify all vs active operators

* feat(operator): add get all operators query

* fix(operator): parse cons key correctly

* chore(lint): placate proto-lint

* chore(lint): placate golang lint

* fix(operator): impl for msgs GetSignBytes, Type

Without these functions implemented, sending a transaction with the
wrong chain-id produces a panic while verifying the signature. This
panic happens on the receiving node (and not the sender), although
consensus isn't impacted.

With these functions implemented, the receiving node replies "signature
verification failed, please verify account number (%d) and chain-id
(%s)". If the transaction were only legacy amino, even the "sequence
(%d)" would have shown up in the error message.

* fix: validatorupdateblock update every block cause messy of upgrade (ExocoreNetwork#57)

* fix(oracle): add copy of aggregatorContext for checkTx-mode of execution (ExocoreNetwork#50)

* fix(oracle): add copy of aggregatorContext for checkTx-mode of execution

* fix lint

* fix(oracle):use set to copy bigInt

* fix(oracle):deep copy on price

* fix(oracle):get rid of map in cache for deteministic serialize

* fix(oracle):bigint set, slice initialize

* GetConsensusPower should have reduction as input

* test(oracle): remove unused monkey-patch

* test: remove unused monkey mock

* fix: error retruned by precompiled contract can not be caught with tr… (ExocoreNetwork#69)

* fix: error retruned by precompiled contract can not be caught with try/catch in EVM

* fix withdraw_integrate_test

* fix failed tests and add some TODO comments

* patch clientchains precompile

* [fix] Fix the issue regarding voting power not taking effect (ExocoreNetwork#65)

* fix the issue ExocoreNetwork#58 regarding voting power not taking effect

* change prepareDelegation to be compatible with PR61

* update ibc-go to v7.4.0 to fix the Vulnerability GO-2024-2694

* change the epoch configuration to hour when start a local node through the local_node.sh

* using shfmt to fix the shell lint error

* refactor: refactor avs and add test

* oracle:add fields for params (ExocoreNetwork#75)

* oracle:add fields for params

* udpate default params with new fields

* fix lint

* test(oracle): convert int type

* feat(build): add commit hash in version name (ExocoreNetwork#76)

* fix:fix golangci-lint error

* fix:fix issues in comments

* fix(assets,delegation): case insensitive query (ExocoreNetwork#80)

* fix(delegation): convert query to lowercase

* fix(assets): convert query to lowercase

* refactor(assets,delegation): check case with flag

* fix(assets,delegation): stateless validate cli

* fix(assets): deprecate StakerExoCoreAddr

* fix(assets): remove StakerExoCoreAddr

* fix(assets): require non-zero address length (ExocoreNetwork#82)

* fix(localnet): set `address_length`

* fix(assets): validate non-zero address length

* fix(app): reorder the EndBlockers (ExocoreNetwork#98)

* chore: update go version to 1.21.11

* fix(ci): disable buggy workflows

till they can be fixed

* fix(app): reorder the EndBlockers

The `EndBlockers` do the following jobs:
- `x/operator` saves the USD value for delegations, indexed by operator.
- `x/dogfood` uses the USD value obtained from `x/operator` to calculate
  the new voting power and forwards the new validator set to Tendermint.
  It also decreases the hold count on pending undelegations maturing at
  that epoch, from the perspective of the dogfood-AVS.
- `x/delegation` releases any matured undelegations and makes assets
  available for withdrawal.
- `x/oracle` fetches the new voting power from `x/dogfood` and prepares
  for the next round.

The new order is updated to reflect the above functions. As a
consequence, delegations made during blocks just before the epoch ends
will also accurately update the vote power of the validators.

* chore: lint

* fix(docker): update to new alpine

* feat(ci): add `docker build` CI

* chore(ci): run `lint` on workflows

* chore(ci): run `lint` on workflows again

* fix(ci): trigger Dockerbuild only if file changes

* fix(ci): remove backticks from workflow name

* fix(ci): lint the workflow again

* fix(ci): use correct path to trigger

* fix(ci): specify go version in consensuswarn (ExocoreNetwork#103)

* refactor(dogfood): return cons key in `Validator` (ExocoreNetwork#72)

* refactor(dogfood): return cons key in `Validator`

Until `x/dogfood` was made compatible with `x/evm` and `x/oracle`, a
`nil` validator was being returned by `ValidatorByConsAddr`. This
validator was correctly processed by the `x/evidence` module when it
handled equivocation evidence.

However, with the changes introduced for compatibiltiy with `x/evm`, the
validator returned is no longer nil. Such a validator will have an
operator address, whose presence will trigger a call to `Validator`,
which is implemented by this change.

* fix(dogfood): add expected keeper interface

* fix(dogfood): return `validator` not `val`

* fix(operator,dogfood): return val with key

* fix(dogfood): correctly set bonded status

The validators loaded from x/dogfood are considered bonded, while the
validators pulled from x/operator can have any status.

* doc(dogfood): add error logs

* fix(ci): specify go version in consensuswarn

* feat(dogfood): implement `ExportGenesis` (ExocoreNetwork#95)

* feat(dogfood): re-scaffold genesis

In preparation for the `ExportGenesis` implementation, re-scaffold the
genesis state of the dogfood module.

* fix(dogfood): remove deprecated keys

* refactor: use new dogfood genesis

* refactor(dogfood): - validatorupdate from gen

* refactor(dogfood): update ImportGenesis

...for new genesis structure

* refactor(dogfood): simplify gen state names

* feat(dogfood): implement ExportGenesis

Partially resolves ExocoreNetwork#54

* chore: lint

* proto(dogfood): remove unused import

* fix(local): compat with new dogfood genesis

* chore: lint proto file and gen

* fix(test): use correct struct member name

* chore: update go version to 1.21.11

* fix(ci): disable buggy workflows

till they can be fixed

* chore: lint

* fix(dogfood): don't stop iterating in export

The return value should be `false` to continue

* fix(doc): add comment about exported validators

* doc(dogfood): log iteration failure

If such an iteration failure happens during export, a pipe to `jq` will
fail and inform the user of the failure.

* docs(delegation): validation of record key params

* fix(app): register operator hooks for dogfood

* feat(operator): return `OptingOut` status

Whenever a query for consensus keys or addresses is answered, it should
specify whether the operator is currently in the process of opting out.
This is because the data is retained until the opt out is complete, even
though the operator may not be actively validating. The purpose of the
data retention, as always, is to slash the operator (if required), based
on the key.

* refactor(operator): rationalize opt-in/out

When an operator opts into an AVS, they should be required to supply the
consensus (or other) key to opt-in. Similarly, when they opt-out, the
key should automatically be removed.

This commit implements that functionality, however, it is restricted to
`ctx.ChainID()`. For an overbroad implementation, an AVS registry from
AVS address -> key type should be implemented.

* refactor(delegation): verbose panic

* fix(dogfood): query validator by cons addr not hex

* refactor(dogfood): move opt func to correct loc

* chore(x/operator): lint go

* fix(operator): wrap and return error

---------

Co-authored-by: cloud8little <[email protected]>

* fix(ci): upgrade deprecated goreleaser

- Set version in `.goreleaser.yml`
- Correct the `goreleaser-cross` version to use the latest available and
  compatible version
- Update workflow to test release builds on pull requests, but not
  publish them

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: leonz789 <[email protected]>
Co-authored-by: Leon <[email protected]>
Co-authored-by: adu <[email protected]>
Co-authored-by: TimmyExogenous <[email protected]>
Co-authored-by: trestin <[email protected]>
Co-authored-by: trestin-web3 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants